\hypertarget{a00054}{}\section{E\+:/knet-\/git/knet/knet/channel\+\_\+ref.h 文件参考}
\label{a00054}\index{E\+:/knet-\/git/knet/knet/channel\+\_\+ref.\+h@{E\+:/knet-\/git/knet/knet/channel\+\_\+ref.\+h}}
{\ttfamily \#include \char`\"{}config.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}channel\+\_\+ref\+\_\+api.\+h\char`\"{}}\\*
\subsection*{函数}
\begin{DoxyCompactItemize}
\item 
\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$ \hyperlink{a00054_ab3c8eae266a90aee181b0cf4e9bcc731_ab3c8eae266a90aee181b0cf4e9bcc731}{knet\+\_\+channel\+\_\+ref\+\_\+create} (\hyperlink{a00056_a97fc76209a58362019f1ded9169e397f_a97fc76209a58362019f1ded9169e397f}{kloop\+\_\+t} $\ast$loop, \hyperlink{a00056_aca9cd34897582aa9969245a93cc62fb5_aca9cd34897582aa9969245a93cc62fb5}{kchannel\+\_\+t} $\ast$channel)
\begin{DoxyCompactList}\small\item\em 创建管道引用 \end{DoxyCompactList}\item 
int \hyperlink{a00054_ae61ef5acd0738591947edac25e2d0ccf_ae61ef5acd0738591947edac25e2d0ccf}{knet\+\_\+channel\+\_\+ref\+\_\+destroy} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 销毁管道引用 管道引用计数为零时才能被实际销毁 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a0bbe382b036918b6a75f8d2d3e8b6a44_a0bbe382b036918b6a75f8d2d3e8b6a44}{knet\+\_\+channel\+\_\+ref\+\_\+close\+\_\+check\+\_\+reconnect} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 关闭管道并检查重连 \end{DoxyCompactList}\item 
int \hyperlink{a00054_a1536dcaeffcf43addfb34b406dbafd4f_a1536dcaeffcf43addfb34b406dbafd4f}{knet\+\_\+channel\+\_\+ref\+\_\+write} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, const char $\ast$data, int size)
\begin{DoxyCompactList}\small\item\em 写入 管道引用计数为零时才能被实际销毁 \end{DoxyCompactList}\item 
\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$ \hyperlink{a00054_a97f52cae86124080471b331333852734_a97f52cae86124080471b331333852734}{knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+from\+\_\+socket\+\_\+fd} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, \hyperlink{a00056_a97fc76209a58362019f1ded9169e397f_a97fc76209a58362019f1ded9169e397f}{kloop\+\_\+t} $\ast$loop, \hyperlink{a00056_a0d9e0afbf02fb6ed6c5b1415dce51b05_a0d9e0afbf02fb6ed6c5b1415dce51b05}{socket\+\_\+t} client\+\_\+fd, int event)
\begin{DoxyCompactList}\small\item\em 为通过accept()返回的套接字创建管道引用 \end{DoxyCompactList}\item 
\hyperlink{a00056_a97fc76209a58362019f1ded9169e397f_a97fc76209a58362019f1ded9169e397f}{kloop\+\_\+t} $\ast$ \hyperlink{a00054_a6388ed40ffcaef7e775cae207486d308_a6388ed40ffcaef7e775cae207486d308}{knet\+\_\+channel\+\_\+ref\+\_\+choose\+\_\+loop} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 取得管道相关联的kloop\+\_\+t实例 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a61952ee84bc8d572ab77163e919a54d8_a61952ee84bc8d572ab77163e919a54d8}{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop\+\_\+node} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, \hyperlink{a00056_ac701f00a0851c97467ae35c382b316b7_ac701f00a0851c97467ae35c382b316b7}{kdlist\+\_\+node\+\_\+t} $\ast$node)
\begin{DoxyCompactList}\small\item\em 设置管道链表节点 \end{DoxyCompactList}\item 
\hyperlink{a00056_ac701f00a0851c97467ae35c382b316b7_ac701f00a0851c97467ae35c382b316b7}{kdlist\+\_\+node\+\_\+t} $\ast$ \hyperlink{a00054_acdd3ead2d27ffb0a86eba8f509631433_acdd3ead2d27ffb0a86eba8f509631433}{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+loop\+\_\+node} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 取得管道链表节点 \end{DoxyCompactList}\item 
int \hyperlink{a00054_a6073314ca2d5893cf909982114ff6b9c_a6073314ca2d5893cf909982114ff6b9c}{knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 在kloop\+\_\+t所运行的线程内完成连接流程 \end{DoxyCompactList}\item 
int \hyperlink{a00054_ab64661cda8927dfc74879f1f4a4bff13_ab64661cda8927dfc74879f1f4a4bff13}{knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop\+\_\+address} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 在kloop\+\_\+t所运行的线程内完成连接流程 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a0f7a4b69f5d64aebd6b33ca0a4311ffb_a0f7a4b69f5d64aebd6b33ca0a4311ffb}{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept\+\_\+in\+\_\+loop} (\hyperlink{a00056_a97fc76209a58362019f1ded9169e397f_a97fc76209a58362019f1ded9169e397f}{kloop\+\_\+t} $\ast$loop, \hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 在kloop\+\_\+t所运行的线程内完成接收新连接流程 通过负载均衡触发 \end{DoxyCompactList}\item 
void \hyperlink{a00054_ac8b7765a914482ea59e209704f8f0fac_ac8b7765a914482ea59e209704f8f0fac}{knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+async} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 在其他完成了listen()和bind()操作，在当前线程的kloop\+\_\+t内监听 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a52b9ae9721f4e2dc6d6d649191c5d59d_a52b9ae9721f4e2dc6d6d649191c5d59d}{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+close\+\_\+in\+\_\+loop} (\hyperlink{a00056_a97fc76209a58362019f1ded9169e397f_a97fc76209a58362019f1ded9169e397f}{kloop\+\_\+t} $\ast$loop, \hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 在kloop\+\_\+t所运行的线程内完成关闭流程 通过跨线程关闭触发 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a3baff51e9f31471fbbac3d5ec4d125f1_a3baff51e9f31471fbbac3d5ec4d125f1}{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send\+\_\+in\+\_\+loop} (\hyperlink{a00056_a97fc76209a58362019f1ded9169e397f_a97fc76209a58362019f1ded9169e397f}{kloop\+\_\+t} $\ast$loop, \hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, \hyperlink{a00056_a4b09a7574cd440f9b94285ab73c81b4e_a4b09a7574cd440f9b94285ab73c81b4e}{kbuffer\+\_\+t} $\ast$send\+\_\+buffer)
\begin{DoxyCompactList}\small\item\em 在kloop\+\_\+t所运行的线程内发送 通过跨线程发送触发 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a2e022541aa1a4ff04a15cd134788e335_a2e022541aa1a4ff04a15cd134788e335}{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+flag} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, int flag)
\begin{DoxyCompactList}\small\item\em 设置管道自定义标志 \end{DoxyCompactList}\item 
int \hyperlink{a00054_ab8e70df787656b096fb57716453fdb62_ab8e70df787656b096fb57716453fdb62}{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+flag} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 取得管道自定义标志 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a9c7f39305266c9bf15cd40b8cdf6013e_a9c7f39305266c9bf15cd40b8cdf6013e}{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+data} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, void $\ast$data)
\begin{DoxyCompactList}\small\item\em 设置管道自定义数据 \end{DoxyCompactList}\item 
void $\ast$ \hyperlink{a00054_a16cd64ed0ec7f68931aea3abd3bf1e24_a16cd64ed0ec7f68931aea3abd3bf1e24}{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+data} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 取得管道自定义数据 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a86bb8fd97323daf88aff1b8e9bbfe47c_a86bb8fd97323daf88aff1b8e9bbfe47c}{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, \hyperlink{a00056_a97fc76209a58362019f1ded9169e397f_a97fc76209a58362019f1ded9169e397f}{kloop\+\_\+t} $\ast$loop)
\begin{DoxyCompactList}\small\item\em 设置管道所属（相关联）kloop\+\_\+t实例 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a660d3d2503c1c6320394fc382e192849_a660d3d2503c1c6320394fc382e192849}{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+event} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, \hyperlink{a00056_accd62b4c787cfb91e81aa14210302863_accd62b4c787cfb91e81aa14210302863}{knet\+\_\+channel\+\_\+event\+\_\+e} e)
\begin{DoxyCompactList}\small\item\em 投递管道事件 \end{DoxyCompactList}\item 
\hyperlink{a00056_accd62b4c787cfb91e81aa14210302863_accd62b4c787cfb91e81aa14210302863}{knet\+\_\+channel\+\_\+event\+\_\+e} \hyperlink{a00054_a8fa7b957151c8dd347d1fbedfea475e5_a8fa7b957151c8dd347d1fbedfea475e5}{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+event} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 获取管道已经投递的事件集合 \end{DoxyCompactList}\item 
void \hyperlink{a00054_ac9f005bb64c11a6cf94a0809aa4e0866_ac9f005bb64c11a6cf94a0809aa4e0866}{knet\+\_\+channel\+\_\+ref\+\_\+clear\+\_\+event} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, \hyperlink{a00056_accd62b4c787cfb91e81aa14210302863_accd62b4c787cfb91e81aa14210302863}{knet\+\_\+channel\+\_\+event\+\_\+e} e)
\begin{DoxyCompactList}\small\item\em 取消管道事件 \end{DoxyCompactList}\item 
int \hyperlink{a00054_ab88ee14b4ea5633be7e4e46c622a40d3_ab88ee14b4ea5633be7e4e46c622a40d3}{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+event} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, \hyperlink{a00056_accd62b4c787cfb91e81aa14210302863_accd62b4c787cfb91e81aa14210302863}{knet\+\_\+channel\+\_\+event\+\_\+e} event)
\begin{DoxyCompactList}\small\item\em 检测是否投递了事件 \end{DoxyCompactList}\item 
void \hyperlink{a00054_aff3748511b10f9d9df9375c5d816eb37_aff3748511b10f9d9df9375c5d816eb37}{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+state} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, \hyperlink{a00056_a74ff83eaafca5c7093accdc65c6b0646_a74ff83eaafca5c7093accdc65c6b0646}{knet\+\_\+channel\+\_\+state\+\_\+e} state)
\begin{DoxyCompactList}\small\item\em 设置管道状态 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a011250f757798988f6da99b53c74e9c8_a011250f757798988f6da99b53c74e9c8}{knet\+\_\+channel\+\_\+ref\+\_\+update} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, \hyperlink{a00056_accd62b4c787cfb91e81aa14210302863_accd62b4c787cfb91e81aa14210302863}{knet\+\_\+channel\+\_\+event\+\_\+e} e, time\+\_\+t ts)
\begin{DoxyCompactList}\small\item\em 管道事件通知 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a39cd9444637453f7cc1b601d0d69eb5b_a39cd9444637453f7cc1b601d0d69eb5b}{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 管道事件处理-\/监听到新连接请求 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a22a512506db436ec5a274202edcba89e_a22a512506db436ec5a274202edcba89e}{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+connect} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 管道事件处理-\/发起连接完成 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a3d90a5ee67452c8083c0f1b3712310fd_a3d90a5ee67452c8083c0f1b3712310fd}{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+recv} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 管道事件处理-\/有数据可读 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a4bdd7b15093a0b5bec991ed019bb130c_a4bdd7b15093a0b5bec991ed019bb130c}{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 管道事件处理-\/可以发送数据 \end{DoxyCompactList}\item 
int \hyperlink{a00054_aa87f4087c20f1937dd7d75ab783e1114_aa87f4087c20f1937dd7d75ab783e1114}{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+connect\+\_\+timeout} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, time\+\_\+t ts)
\begin{DoxyCompactList}\small\item\em 检测管道发起的连接操作是否超时 \end{DoxyCompactList}\item 
int \hyperlink{a00054_acaa4747a62cce770cc798c2c30bf2670_acaa4747a62cce770cc798c2c30bf2670}{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+timeout} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, time\+\_\+t ts)
\begin{DoxyCompactList}\small\item\em 检测管道是否空闲超时 \end{DoxyCompactList}\item 
\hyperlink{a00056_a66d91f7667db1f0b2983fc25e1a20f1c_a66d91f7667db1f0b2983fc25e1a20f1c}{kringbuffer\+\_\+t} $\ast$ \hyperlink{a00054_a223616ac0204f928d4c85e2d59d98bda_a223616ac0204f928d4c85e2d59d98bda}{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ringbuffer} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 取得管道读缓冲区 \end{DoxyCompactList}\item 
\hyperlink{a00056_a8a7d96123ef4565c6d08fe58a10476a9_a8a7d96123ef4565c6d08fe58a10476a9}{knet\+\_\+channel\+\_\+ref\+\_\+cb\+\_\+t} \hyperlink{a00054_a51588a9377f745308695f9332c4e242f_a51588a9377f745308695f9332c4e242f}{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+cb} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 取得管道事件回调 \end{DoxyCompactList}\item 
void \hyperlink{a00054_a9576bac459baba7c258ae8504f1fbad3_a9576bac459baba7c258ae8504f1fbad3}{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+node} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, \hyperlink{a00056_ac701f00a0851c97467ae35c382b316b7_ac701f00a0851c97467ae35c382b316b7}{kdlist\+\_\+node\+\_\+t} $\ast$node)
\begin{DoxyCompactList}\small\item\em 设置域链表节点 \end{DoxyCompactList}\item 
\hyperlink{a00056_ac701f00a0851c97467ae35c382b316b7_ac701f00a0851c97467ae35c382b316b7}{kdlist\+\_\+node\+\_\+t} $\ast$ \hyperlink{a00054_a73d7e2605300866e15b64bc0aa70f16d_a73d7e2605300866e15b64bc0aa70f16d}{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+node} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 取得域链表节点 \end{DoxyCompactList}\item 
int \hyperlink{a00054_a320eba2d439fc73634d1da04d1aa331e_a320eba2d439fc73634d1da04d1aa331e}{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+share} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 检查管道引用是否通过调用knet\+\_\+channel\+\_\+ref\+\_\+share()建立 \end{DoxyCompactList}\item 
void \hyperlink{a00054_ab95b2c215da829c9f6cec2d7519bb79e_ab95b2c215da829c9f6cec2d7519bb79e}{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+id} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref, uint64\+\_\+t domain\+\_\+id)
\begin{DoxyCompactList}\small\item\em 设置域\+I\+D \end{DoxyCompactList}\item 
uint64\+\_\+t \hyperlink{a00054_a1c889495cfd41279b4f9322f5361161f_a1c889495cfd41279b4f9322f5361161f}{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+id} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 取得域\+I\+D \end{DoxyCompactList}\item 
void \hyperlink{a00054_aa2180d5a8bdc915fd31983a3b5b17322_aa2180d5a8bdc915fd31983a3b5b17322}{knet\+\_\+channel\+\_\+ref\+\_\+incref} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 递增当前管道引用计数 \end{DoxyCompactList}\item 
void \hyperlink{a00054_ae45c4b7c756ea6668832f1b302821363_ae45c4b7c756ea6668832f1b302821363}{knet\+\_\+channel\+\_\+ref\+\_\+decref} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 递减当前管道引用计数 \end{DoxyCompactList}\item 
int \hyperlink{a00054_a83ec9381b50f17f920319cae57007bb7_a83ec9381b50f17f920319cae57007bb7}{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+ref\+\_\+zero} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 测试管道引用是否为零 \end{DoxyCompactList}\item 
int \hyperlink{a00054_ab11817f208b858dea9792a0c9ea9e4bb_ab11817f208b858dea9792a0c9ea9e4bb}{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ref} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel\+\_\+ref)
\begin{DoxyCompactList}\small\item\em 获取管道引用计数 \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{函数说明}
\hypertarget{a00054_ac8b7765a914482ea59e209704f8f0fac_ac8b7765a914482ea59e209704f8f0fac}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+async@{knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+async}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+async@{knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+async}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+async}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+async (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_ac8b7765a914482ea59e209704f8f0fac_ac8b7765a914482ea59e209704f8f0fac}


在其他完成了listen()和bind()操作，在当前线程的kloop\+\_\+t内监听 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a97f52cae86124080471b331333852734_a97f52cae86124080471b331333852734}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+from\+\_\+socket\+\_\+fd@{knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+from\+\_\+socket\+\_\+fd}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+from\+\_\+socket\+\_\+fd@{knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+from\+\_\+socket\+\_\+fd}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+from\+\_\+socket\+\_\+fd}]{\setlength{\rightskip}{0pt plus 5cm}{\bf kchannel\+\_\+ref\+\_\+t}$\ast$ knet\+\_\+channel\+\_\+ref\+\_\+accept\+\_\+from\+\_\+socket\+\_\+fd (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{{\bf kloop\+\_\+t} $\ast$}]{loop, }
\item[{{\bf socket\+\_\+t}}]{client\+\_\+fd, }
\item[{int}]{event}
\end{DoxyParamCaption}
)}\label{a00054_a97f52cae86124080471b331333852734_a97f52cae86124080471b331333852734}


为通过accept()返回的套接字创建管道引用 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em loop} & kloop\+\_\+t实例 \\
\hline
{\em client\+\_\+fd} & 通过accept()得到的套接字 \\
\hline
{\em event} & 是否投递事件和设置管道状态 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
kchannel\+\_\+ref\+\_\+t实例 
\end{DoxyReturn}
\hypertarget{a00054_aa87f4087c20f1937dd7d75ab783e1114_aa87f4087c20f1937dd7d75ab783e1114}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+connect\+\_\+timeout@{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+connect\+\_\+timeout}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+connect\+\_\+timeout@{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+connect\+\_\+timeout}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+connect\+\_\+timeout}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+connect\+\_\+timeout (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{time\+\_\+t}]{ts}
\end{DoxyParamCaption}
)}\label{a00054_aa87f4087c20f1937dd7d75ab783e1114_aa87f4087c20f1937dd7d75ab783e1114}


检测管道发起的连接操作是否超时 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em ts} & 当前时间戳（秒） \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{返回值}
{\em 0} & 没有超时 \\
\hline
{\em 非零} & 超时 \\
\hline
\end{DoxyRetVals}
\hypertarget{a00054_ab88ee14b4ea5633be7e4e46c622a40d3_ab88ee14b4ea5633be7e4e46c622a40d3}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+event@{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+event}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+event@{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+event}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+event}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+event (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{{\bf knet\+\_\+channel\+\_\+event\+\_\+e}}]{event}
\end{DoxyParamCaption}
)}\label{a00054_ab88ee14b4ea5633be7e4e46c622a40d3_ab88ee14b4ea5633be7e4e46c622a40d3}


检测是否投递了事件 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em event} & 管道事件 \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{返回值}
{\em 0} & 没有投递 \\
\hline
{\em 非零} & 已经投递 \\
\hline
\end{DoxyRetVals}
\hypertarget{a00054_a83ec9381b50f17f920319cae57007bb7_a83ec9381b50f17f920319cae57007bb7}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+ref\+\_\+zero@{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+ref\+\_\+zero}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+ref\+\_\+zero@{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+ref\+\_\+zero}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+ref\+\_\+zero}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+ref\+\_\+zero (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a83ec9381b50f17f920319cae57007bb7_a83ec9381b50f17f920319cae57007bb7}


测试管道引用是否为零 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
0 不为零 

非零 为零 
\end{DoxyReturn}
\hypertarget{a00054_a320eba2d439fc73634d1da04d1aa331e_a320eba2d439fc73634d1da04d1aa331e}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+share@{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+share}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+share@{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+share}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+share}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+share (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a320eba2d439fc73634d1da04d1aa331e_a320eba2d439fc73634d1da04d1aa331e}


检查管道引用是否通过调用knet\+\_\+channel\+\_\+ref\+\_\+share()建立 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{返回值}
{\em 0} & 不是 \\
\hline
{\em 非零} & 是 \\
\hline
\end{DoxyRetVals}
\hypertarget{a00054_acaa4747a62cce770cc798c2c30bf2670_acaa4747a62cce770cc798c2c30bf2670}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+timeout@{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+timeout}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+timeout@{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+timeout}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+timeout}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+channel\+\_\+ref\+\_\+check\+\_\+timeout (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{time\+\_\+t}]{ts}
\end{DoxyParamCaption}
)}\label{a00054_acaa4747a62cce770cc798c2c30bf2670_acaa4747a62cce770cc798c2c30bf2670}


检测管道是否空闲超时 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em ts} & 当前时间戳（秒） \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{返回值}
{\em 0} & 没有超时 \\
\hline
{\em 非零} & 超时 \\
\hline
\end{DoxyRetVals}
\hypertarget{a00054_a6388ed40ffcaef7e775cae207486d308_a6388ed40ffcaef7e775cae207486d308}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+choose\+\_\+loop@{knet\+\_\+channel\+\_\+ref\+\_\+choose\+\_\+loop}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+choose\+\_\+loop@{knet\+\_\+channel\+\_\+ref\+\_\+choose\+\_\+loop}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+choose\+\_\+loop}]{\setlength{\rightskip}{0pt plus 5cm}{\bf kloop\+\_\+t}$\ast$ knet\+\_\+channel\+\_\+ref\+\_\+choose\+\_\+loop (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a6388ed40ffcaef7e775cae207486d308_a6388ed40ffcaef7e775cae207486d308}


取得管道相关联的kloop\+\_\+t实例 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
kloop\+\_\+t实例 
\end{DoxyReturn}
\hypertarget{a00054_ac9f005bb64c11a6cf94a0809aa4e0866_ac9f005bb64c11a6cf94a0809aa4e0866}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+clear\+\_\+event@{knet\+\_\+channel\+\_\+ref\+\_\+clear\+\_\+event}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+clear\+\_\+event@{knet\+\_\+channel\+\_\+ref\+\_\+clear\+\_\+event}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+clear\+\_\+event}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+clear\+\_\+event (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{{\bf knet\+\_\+channel\+\_\+event\+\_\+e}}]{e}
\end{DoxyParamCaption}
)}\label{a00054_ac9f005bb64c11a6cf94a0809aa4e0866_ac9f005bb64c11a6cf94a0809aa4e0866}


取消管道事件 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em e} & 管道事件 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a0bbe382b036918b6a75f8d2d3e8b6a44_a0bbe382b036918b6a75f8d2d3e8b6a44}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+close\+\_\+check\+\_\+reconnect@{knet\+\_\+channel\+\_\+ref\+\_\+close\+\_\+check\+\_\+reconnect}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+close\+\_\+check\+\_\+reconnect@{knet\+\_\+channel\+\_\+ref\+\_\+close\+\_\+check\+\_\+reconnect}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+close\+\_\+check\+\_\+reconnect}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+close\+\_\+check\+\_\+reconnect (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a0bbe382b036918b6a75f8d2d3e8b6a44_a0bbe382b036918b6a75f8d2d3e8b6a44}


关闭管道并检查重连 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a6073314ca2d5893cf909982114ff6b9c_a6073314ca2d5893cf909982114ff6b9c}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop@{knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop@{knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a6073314ca2d5893cf909982114ff6b9c_a6073314ca2d5893cf909982114ff6b9c}


在kloop\+\_\+t所运行的线程内完成连接流程 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{返回值}
{\em error\+\_\+ok} & 成功 \\
\hline
{\em 其他} & 失败 \\
\hline
\end{DoxyRetVals}
\hypertarget{a00054_ab64661cda8927dfc74879f1f4a4bff13_ab64661cda8927dfc74879f1f4a4bff13}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop\+\_\+address@{knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop\+\_\+address}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop\+\_\+address@{knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop\+\_\+address}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop\+\_\+address}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+channel\+\_\+ref\+\_\+connect\+\_\+in\+\_\+loop\+\_\+address (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_ab64661cda8927dfc74879f1f4a4bff13_ab64661cda8927dfc74879f1f4a4bff13}


在kloop\+\_\+t所运行的线程内完成连接流程 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{返回值}
{\em error\+\_\+ok} & 成功 \\
\hline
{\em 其他} & 失败 \\
\hline
\end{DoxyRetVals}
\hypertarget{a00054_ab3c8eae266a90aee181b0cf4e9bcc731_ab3c8eae266a90aee181b0cf4e9bcc731}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+create@{knet\+\_\+channel\+\_\+ref\+\_\+create}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+create@{knet\+\_\+channel\+\_\+ref\+\_\+create}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+create}]{\setlength{\rightskip}{0pt plus 5cm}{\bf kchannel\+\_\+ref\+\_\+t}$\ast$ knet\+\_\+channel\+\_\+ref\+\_\+create (
\begin{DoxyParamCaption}
\item[{{\bf kloop\+\_\+t} $\ast$}]{loop, }
\item[{{\bf kchannel\+\_\+t} $\ast$}]{channel}
\end{DoxyParamCaption}
)}\label{a00054_ab3c8eae266a90aee181b0cf4e9bcc731_ab3c8eae266a90aee181b0cf4e9bcc731}


创建管道引用 


\begin{DoxyParams}{参数}
{\em loop} & kloop\+\_\+t实例 \\
\hline
{\em channel} & kchannel\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
kchannel\+\_\+ref\+\_\+t实例 
\end{DoxyReturn}
\hypertarget{a00054_ae45c4b7c756ea6668832f1b302821363_ae45c4b7c756ea6668832f1b302821363}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+decref@{knet\+\_\+channel\+\_\+ref\+\_\+decref}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+decref@{knet\+\_\+channel\+\_\+ref\+\_\+decref}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+decref}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+decref (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_ae45c4b7c756ea6668832f1b302821363_ae45c4b7c756ea6668832f1b302821363}


递减当前管道引用计数 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_ae61ef5acd0738591947edac25e2d0ccf_ae61ef5acd0738591947edac25e2d0ccf}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+destroy@{knet\+\_\+channel\+\_\+ref\+\_\+destroy}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+destroy@{knet\+\_\+channel\+\_\+ref\+\_\+destroy}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+destroy}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+channel\+\_\+ref\+\_\+destroy (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_ae61ef5acd0738591947edac25e2d0ccf_ae61ef5acd0738591947edac25e2d0ccf}


销毁管道引用 管道引用计数为零时才能被实际销毁 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{返回值}
{\em error\+\_\+ok} & 成功 \\
\hline
{\em 其他} & 失败 \\
\hline
\end{DoxyRetVals}
\hypertarget{a00054_a51588a9377f745308695f9332c4e242f_a51588a9377f745308695f9332c4e242f}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+cb@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+cb}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+cb@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+cb}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+cb}]{\setlength{\rightskip}{0pt plus 5cm}{\bf knet\+\_\+channel\+\_\+ref\+\_\+cb\+\_\+t} knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+cb (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a51588a9377f745308695f9332c4e242f_a51588a9377f745308695f9332c4e242f}


取得管道事件回调 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
回调函数指针 
\end{DoxyReturn}
\hypertarget{a00054_a16cd64ed0ec7f68931aea3abd3bf1e24_a16cd64ed0ec7f68931aea3abd3bf1e24}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+data@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+data}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+data@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+data}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+data}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+data (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a16cd64ed0ec7f68931aea3abd3bf1e24_a16cd64ed0ec7f68931aea3abd3bf1e24}


取得管道自定义数据 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
自定义数据指针 
\end{DoxyReturn}
\hypertarget{a00054_a1c889495cfd41279b4f9322f5361161f_a1c889495cfd41279b4f9322f5361161f}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+id@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+id}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+id@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+id}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+id}]{\setlength{\rightskip}{0pt plus 5cm}uint64\+\_\+t knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+id (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a1c889495cfd41279b4f9322f5361161f_a1c889495cfd41279b4f9322f5361161f}


取得域\+I\+D 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
域\+I\+D 
\end{DoxyReturn}
\hypertarget{a00054_a73d7e2605300866e15b64bc0aa70f16d_a73d7e2605300866e15b64bc0aa70f16d}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+node@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+node}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+node@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+node}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+node}]{\setlength{\rightskip}{0pt plus 5cm}{\bf kdlist\+\_\+node\+\_\+t}$\ast$ knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+domain\+\_\+node (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a73d7e2605300866e15b64bc0aa70f16d_a73d7e2605300866e15b64bc0aa70f16d}


取得域链表节点 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
kdlist\+\_\+node\+\_\+t实例 
\end{DoxyReturn}
\hypertarget{a00054_a8fa7b957151c8dd347d1fbedfea475e5_a8fa7b957151c8dd347d1fbedfea475e5}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+event@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+event}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+event@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+event}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+event}]{\setlength{\rightskip}{0pt plus 5cm}{\bf knet\+\_\+channel\+\_\+event\+\_\+e} knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+event (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a8fa7b957151c8dd347d1fbedfea475e5_a8fa7b957151c8dd347d1fbedfea475e5}


获取管道已经投递的事件集合 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
管道事件集合 
\end{DoxyReturn}
\hypertarget{a00054_ab8e70df787656b096fb57716453fdb62_ab8e70df787656b096fb57716453fdb62}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+flag@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+flag}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+flag@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+flag}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+flag}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+flag (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_ab8e70df787656b096fb57716453fdb62_ab8e70df787656b096fb57716453fdb62}


取得管道自定义标志 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
自定义标志 
\end{DoxyReturn}
\hypertarget{a00054_acdd3ead2d27ffb0a86eba8f509631433_acdd3ead2d27ffb0a86eba8f509631433}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+loop\+\_\+node@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+loop\+\_\+node}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+loop\+\_\+node@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+loop\+\_\+node}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+loop\+\_\+node}]{\setlength{\rightskip}{0pt plus 5cm}{\bf kdlist\+\_\+node\+\_\+t}$\ast$ knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+loop\+\_\+node (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_acdd3ead2d27ffb0a86eba8f509631433_acdd3ead2d27ffb0a86eba8f509631433}


取得管道链表节点 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
kdlist\+\_\+node\+\_\+t实例 
\end{DoxyReturn}
\hypertarget{a00054_ab11817f208b858dea9792a0c9ea9e4bb_ab11817f208b858dea9792a0c9ea9e4bb}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ref@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ref}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ref@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ref}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ref}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ref (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_ab11817f208b858dea9792a0c9ea9e4bb_ab11817f208b858dea9792a0c9ea9e4bb}


获取管道引用计数 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
管道引用计数 
\end{DoxyReturn}
\hypertarget{a00054_a223616ac0204f928d4c85e2d59d98bda_a223616ac0204f928d4c85e2d59d98bda}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ringbuffer@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ringbuffer}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ringbuffer@{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ringbuffer}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ringbuffer}]{\setlength{\rightskip}{0pt plus 5cm}{\bf kringbuffer\+\_\+t}$\ast$ knet\+\_\+channel\+\_\+ref\+\_\+get\+\_\+ringbuffer (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a223616ac0204f928d4c85e2d59d98bda_a223616ac0204f928d4c85e2d59d98bda}


取得管道读缓冲区 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
kringbuffer\+\_\+t实例 
\end{DoxyReturn}
\hypertarget{a00054_aa2180d5a8bdc915fd31983a3b5b17322_aa2180d5a8bdc915fd31983a3b5b17322}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+incref@{knet\+\_\+channel\+\_\+ref\+\_\+incref}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+incref@{knet\+\_\+channel\+\_\+ref\+\_\+incref}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+incref}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+incref (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_aa2180d5a8bdc915fd31983a3b5b17322_aa2180d5a8bdc915fd31983a3b5b17322}


递增当前管道引用计数 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a9c7f39305266c9bf15cd40b8cdf6013e_a9c7f39305266c9bf15cd40b8cdf6013e}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+data@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+data}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+data@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+data}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+data}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+data (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{void $\ast$}]{data}
\end{DoxyParamCaption}
)}\label{a00054_a9c7f39305266c9bf15cd40b8cdf6013e_a9c7f39305266c9bf15cd40b8cdf6013e}


设置管道自定义数据 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em data} & 自定义数据指针 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_ab95b2c215da829c9f6cec2d7519bb79e_ab95b2c215da829c9f6cec2d7519bb79e}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+id@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+id}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+id@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+id}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+id}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+id (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{uint64\+\_\+t}]{domain\+\_\+id}
\end{DoxyParamCaption}
)}\label{a00054_ab95b2c215da829c9f6cec2d7519bb79e_ab95b2c215da829c9f6cec2d7519bb79e}


设置域\+I\+D 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em domain\+\_\+id} & 域\+I\+D \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a9576bac459baba7c258ae8504f1fbad3_a9576bac459baba7c258ae8504f1fbad3}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+node@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+node}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+node@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+node}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+node}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+domain\+\_\+node (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{{\bf kdlist\+\_\+node\+\_\+t} $\ast$}]{node}
\end{DoxyParamCaption}
)}\label{a00054_a9576bac459baba7c258ae8504f1fbad3_a9576bac459baba7c258ae8504f1fbad3}


设置域链表节点 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em node} & 域链表节点 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a660d3d2503c1c6320394fc382e192849_a660d3d2503c1c6320394fc382e192849}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+event@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+event}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+event@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+event}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+event}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+event (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{{\bf knet\+\_\+channel\+\_\+event\+\_\+e}}]{e}
\end{DoxyParamCaption}
)}\label{a00054_a660d3d2503c1c6320394fc382e192849_a660d3d2503c1c6320394fc382e192849}


投递管道事件 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em e} & 管道事件 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a2e022541aa1a4ff04a15cd134788e335_a2e022541aa1a4ff04a15cd134788e335}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+flag@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+flag}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+flag@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+flag}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+flag}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+flag (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{int}]{flag}
\end{DoxyParamCaption}
)}\label{a00054_a2e022541aa1a4ff04a15cd134788e335_a2e022541aa1a4ff04a15cd134788e335}


设置管道自定义标志 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em flag} & 自定义标志 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a86bb8fd97323daf88aff1b8e9bbfe47c_a86bb8fd97323daf88aff1b8e9bbfe47c}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{{\bf kloop\+\_\+t} $\ast$}]{loop}
\end{DoxyParamCaption}
)}\label{a00054_a86bb8fd97323daf88aff1b8e9bbfe47c_a86bb8fd97323daf88aff1b8e9bbfe47c}


设置管道所属（相关联）kloop\+\_\+t实例 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em loop} & kloop\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a61952ee84bc8d572ab77163e919a54d8_a61952ee84bc8d572ab77163e919a54d8}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop\+\_\+node@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop\+\_\+node}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop\+\_\+node@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop\+\_\+node}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop\+\_\+node}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+loop\+\_\+node (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{{\bf kdlist\+\_\+node\+\_\+t} $\ast$}]{node}
\end{DoxyParamCaption}
)}\label{a00054_a61952ee84bc8d572ab77163e919a54d8_a61952ee84bc8d572ab77163e919a54d8}


设置管道链表节点 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em node} & 链表节点 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_aff3748511b10f9d9df9375c5d816eb37_aff3748511b10f9d9df9375c5d816eb37}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+state@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+state}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+state@{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+state}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+state}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+set\+\_\+state (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{{\bf knet\+\_\+channel\+\_\+state\+\_\+e}}]{state}
\end{DoxyParamCaption}
)}\label{a00054_aff3748511b10f9d9df9375c5d816eb37_aff3748511b10f9d9df9375c5d816eb37}


设置管道状态 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em state} & 管道状态 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a011250f757798988f6da99b53c74e9c8_a011250f757798988f6da99b53c74e9c8}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+update@{knet\+\_\+channel\+\_\+ref\+\_\+update}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+update@{knet\+\_\+channel\+\_\+ref\+\_\+update}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+update}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+update (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{{\bf knet\+\_\+channel\+\_\+event\+\_\+e}}]{e, }
\item[{time\+\_\+t}]{ts}
\end{DoxyParamCaption}
)}\label{a00054_a011250f757798988f6da99b53c74e9c8_a011250f757798988f6da99b53c74e9c8}


管道事件通知 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em e} & 管道事件 \\
\hline
{\em ts} & 当前时间戳（秒） \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a39cd9444637453f7cc1b601d0d69eb5b_a39cd9444637453f7cc1b601d0d69eb5b}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a39cd9444637453f7cc1b601d0d69eb5b_a39cd9444637453f7cc1b601d0d69eb5b}


管道事件处理-\/监听到新连接请求 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a0f7a4b69f5d64aebd6b33ca0a4311ffb_a0f7a4b69f5d64aebd6b33ca0a4311ffb}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept\+\_\+in\+\_\+loop@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept\+\_\+in\+\_\+loop}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept\+\_\+in\+\_\+loop@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept\+\_\+in\+\_\+loop}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept\+\_\+in\+\_\+loop}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+accept\+\_\+in\+\_\+loop (
\begin{DoxyParamCaption}
\item[{{\bf kloop\+\_\+t} $\ast$}]{loop, }
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a0f7a4b69f5d64aebd6b33ca0a4311ffb_a0f7a4b69f5d64aebd6b33ca0a4311ffb}


在kloop\+\_\+t所运行的线程内完成接收新连接流程 通过负载均衡触发 


\begin{DoxyParams}{参数}
{\em loop} & kloop\+\_\+t实例 \\
\hline
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a52b9ae9721f4e2dc6d6d649191c5d59d_a52b9ae9721f4e2dc6d6d649191c5d59d}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+close\+\_\+in\+\_\+loop@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+close\+\_\+in\+\_\+loop}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+close\+\_\+in\+\_\+loop@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+close\+\_\+in\+\_\+loop}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+close\+\_\+in\+\_\+loop}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+close\+\_\+in\+\_\+loop (
\begin{DoxyParamCaption}
\item[{{\bf kloop\+\_\+t} $\ast$}]{loop, }
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a52b9ae9721f4e2dc6d6d649191c5d59d_a52b9ae9721f4e2dc6d6d649191c5d59d}


在kloop\+\_\+t所运行的线程内完成关闭流程 通过跨线程关闭触发 


\begin{DoxyParams}{参数}
{\em loop} & kloop\+\_\+t实例 \\
\hline
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a22a512506db436ec5a274202edcba89e_a22a512506db436ec5a274202edcba89e}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+connect@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+connect}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+connect@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+connect}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+connect}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+connect (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a22a512506db436ec5a274202edcba89e_a22a512506db436ec5a274202edcba89e}


管道事件处理-\/发起连接完成 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a3d90a5ee67452c8083c0f1b3712310fd_a3d90a5ee67452c8083c0f1b3712310fd}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+recv@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+recv}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+recv@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+recv}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+recv}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+recv (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a3d90a5ee67452c8083c0f1b3712310fd_a3d90a5ee67452c8083c0f1b3712310fd}


管道事件处理-\/有数据可读 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a4bdd7b15093a0b5bec991ed019bb130c_a4bdd7b15093a0b5bec991ed019bb130c}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref}
\end{DoxyParamCaption}
)}\label{a00054_a4bdd7b15093a0b5bec991ed019bb130c_a4bdd7b15093a0b5bec991ed019bb130c}


管道事件处理-\/可以发送数据 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a3baff51e9f31471fbbac3d5ec4d125f1_a3baff51e9f31471fbbac3d5ec4d125f1}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send\+\_\+in\+\_\+loop@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send\+\_\+in\+\_\+loop}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send\+\_\+in\+\_\+loop@{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send\+\_\+in\+\_\+loop}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send\+\_\+in\+\_\+loop}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+channel\+\_\+ref\+\_\+update\+\_\+send\+\_\+in\+\_\+loop (
\begin{DoxyParamCaption}
\item[{{\bf kloop\+\_\+t} $\ast$}]{loop, }
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{{\bf kbuffer\+\_\+t} $\ast$}]{send\+\_\+buffer}
\end{DoxyParamCaption}
)}\label{a00054_a3baff51e9f31471fbbac3d5ec4d125f1_a3baff51e9f31471fbbac3d5ec4d125f1}


在kloop\+\_\+t所运行的线程内发送 通过跨线程发送触发 


\begin{DoxyParams}{参数}
{\em loop} & kloop\+\_\+t实例 \\
\hline
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em send\+\_\+buffer} & kbuffer\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00054_a1536dcaeffcf43addfb34b406dbafd4f_a1536dcaeffcf43addfb34b406dbafd4f}{}\index{channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}!knet\+\_\+channel\+\_\+ref\+\_\+write@{knet\+\_\+channel\+\_\+ref\+\_\+write}}
\index{knet\+\_\+channel\+\_\+ref\+\_\+write@{knet\+\_\+channel\+\_\+ref\+\_\+write}!channel\+\_\+ref.\+h@{channel\+\_\+ref.\+h}}
\subsubsection[{knet\+\_\+channel\+\_\+ref\+\_\+write}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+channel\+\_\+ref\+\_\+write (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel\+\_\+ref, }
\item[{const char $\ast$}]{data, }
\item[{int}]{size}
\end{DoxyParamCaption}
)}\label{a00054_a1536dcaeffcf43addfb34b406dbafd4f_a1536dcaeffcf43addfb34b406dbafd4f}


写入 管道引用计数为零时才能被实际销毁 


\begin{DoxyParams}{参数}
{\em channel\+\_\+ref} & kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em data} & 写入数据指针 \\
\hline
{\em size} & 数据长度 \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{返回值}
{\em error\+\_\+ok} & 成功 \\
\hline
{\em 其他} & 失败 \\
\hline
\end{DoxyRetVals}
